package com.csu.jpetstore_reconfiguration_back.service;

import com.csu.jpetstore_reconfiguration_back.common.CommonResponse;
import com.csu.jpetstore_reconfiguration_back.domain.Cart;
import com.baomidou.mybatisplus.extension.service.IService;
import com.csu.jpetstore_reconfiguration_back.vo.CartVO;

import java.util.List;
import jakarta.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.PathVariable;

/**
* @author Lenovo
* @description 针对表【t_cart】的数据库操作Service
* @createDate 2024-04-23 23:05:03
*/
public interface CartService extends IService<Cart> {
    CommonResponse<CartVO> addCart(Cart cart, HttpServletRequest request);
    CommonResponse<CartVO> updateCart(@PathVariable Cart cart, HttpServletRequest request);
    //获取购物车内商品信息
    CommonResponse<List<CartVO>> getCartItems(HttpServletRequest request);
    //删除购物车内的商品
    CommonResponse<CartVO> deleteCartItem(String id,HttpServletRequest request);
    //根据userid查询购物车
    CommonResponse<List<CartVO>> getCartItemsByUserId(HttpServletRequest request);
}
